<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style>
        body {
            width: 920px;
            margin: 0 auto;
        }
        .subject {
            margin: 20px 20px;
        }
        .sname {
            font: bold 28px Arial;
        }
        a {
            color: blue;
            text-decoration: none;
        }
        .nav {
            float: right;
            margin-top: 20px;
        }
        .nav+h2 {
            clear: both;
        }
    </style>
</head>
<body>
    <div class="nav">
        {% if request.session.userid %}
        {{ request.session.username }}
        <a href="/logout/">注销</a>
        {% else %}
        <a href="/login/">登录</a>&nbsp;
        {% endif %}
        <a href="">注册</a>
    </div>
    <h2>千锋教育成都校区所有学科</h2>
    <hr>
    {% for subject in subjects %}
    <div class="subject">
        <p class="sname">
            <a href="/teachers/?sno={{ subject.no }}">{{ subject.name }}</a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            {% if subject.is_hot %}
            <img src='/static/images/hot-icon-small.png'>
            {% endif %}
        </p>
        <p>{{ subject.intro }}</p>
    </div>
    {% endfor %}
</body>
</html>